# coding:utf-8
from ultralytics import YOLO

if __name__ == '__main__':
    # 所需加载的模型目录
    path = 'D:/PycharmProjects/yolo_v8/detection/runs/detect/train8/weights/best.pt'
    # 加载预训练模型
    model = YOLO(path, task='detect')
    metrics = model.val()
    print(metrics)

